#!/bin/sh
CMD_NAME=$(basename $0)

if [ $# -lt 2 ]
then
    echo "${CMD_NAME} [interface] [filename] [expression]"
    exit
fi

INTERFACE=$1
shift
FILENAME=$1
shift
EXPRESSION=$*

sudo tcpdump -i ${INTERFACE} -C 10 -Z root -z gzip -s0 -w ${FILENAME} ${EXPRESSION}
